home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / SpinBP.h.z / SpinBP.h
C/C++ Source or Header  |  2002-10-15  |  5KB  |  178 lines

  1. /* $XConsortium: SpinBP.h /main/6 1995/07/15 20:55:50 drk $ */
  2. /*
  3.  *  @OSF_COPYRIGHT@
  4.  *  COPYRIGHT NOTICE
  5.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  6.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  7.  *  the full copyright text.
  8.  */
  9. /*
  10.  * HISTORY
  11.  */
  12.  
  13. #ifndef _SpinBP_h
  14. #define _SpinBP_h
  15.  
  16. #include <Xm/LabelP.h>
  17. #include <Xm/ManagerP.h>
  18. #include <Xm/SpinB.h>
  19.  
  20. /*  Spin constraints */
  21.  
  22. typedef struct _XmSpinBoxConstraint
  23. {
  24.   XmStringTable  values;        /* array of XmString */
  25.   int            position;      /* position of current selection */
  26.   int            num_values;    /* number of XmString in the array */
  27.  
  28.   int            minimum_value; /* parameters for autonumeric mode */
  29.   int            maximum_value;
  30.   int            increment_value;
  31.   short             decimal_points;
  32.  
  33.   unsigned char  sb_child_type;
  34.   unsigned char  arrow_sensitivity;
  35.   Boolean     wrap;
  36.   unsigned char  position_type; /* governs interpretation of .position:
  37.                     XmPOSITION_{ARRAY,VALUE} */
  38.   
  39. #ifdef _SGIMOTIF
  40.   XtPointer    _SG_vendorExtension;
  41. #endif
  42.  
  43. } XmSpinBoxConstraintPart, *XmSpinBoxConstraint;
  44.  
  45. typedef struct _XmSpinBoxConstraintRec
  46. {
  47.   XmManagerConstraintPart manager;
  48.   XmSpinBoxConstraintPart spinBox;
  49. } XmSpinBoxConstraintRec, *XmSpinBoxConstraintPtr;
  50.  
  51. typedef Widget    (*XmGetCallbackWidgetProc)(Widget);
  52.  
  53. /*  Spin class structure  */
  54. typedef struct _XmSpinBoxClassPart
  55. {
  56.   XmGetCallbackWidgetProc    get_callback_widget;
  57.   XtPointer                  extension;            /* not used */
  58.   
  59. #ifdef _SGIMOTIF
  60.   XtPointer    _SG_vendorExtension;
  61. #endif
  62.  
  63. } XmSpinBoxClassPart;
  64.  
  65.  
  66. /*  Full class record declaration for Spin class  */
  67.  
  68. typedef struct _XmSpinBoxClassRec
  69. {
  70.   CoreClassPart              core_class;
  71.   CompositeClassPart         composite_class;
  72.   ConstraintClassPart        constraint_class;
  73.   XmManagerClassPart         manager_class;
  74.   XmSpinBoxClassPart         spinBox_class;
  75. } XmSpinBoxClassRec;
  76.  
  77. externalref XmSpinBoxClassRec xmSpinBoxClassRec;
  78.  
  79. /*  The Spin instance record  */
  80.  
  81. typedef struct _XmSpinBoxPart
  82. {
  83.       Dimension         arrow_size;
  84.       Dimension         margin_width;
  85.       Dimension         margin_height;
  86.       Dimension         spacing;
  87.       unsigned int   initial_delay;
  88.       unsigned int   repeat_delay;
  89.       XtCallbackList modify_verify_cb; /* CB list for new selection */
  90.       XtCallbackList value_changed_cb; /* CB list for new selection */
  91.       XRectangle     up_arrow_rect;
  92.       XRectangle     down_arrow_rect;
  93.       Widget         textw;         /* text widget */
  94.       int         boundary;
  95.       int         last_hit;
  96.       int         make_change;
  97.       Dimension         ideal_height;
  98.       Dimension         ideal_width;
  99.       GC         arrow_gc;
  100.       GC         insensitive_gc;
  101.       Mask         dim_mask;         /* for the navigator trait */
  102.       XtIntervalId   spin_timer;
  103.       Boolean         up_arrow_pressed;
  104.       Boolean         down_arrow_pressed;
  105.       unsigned char  arrow_layout;
  106.       unsigned char  default_arrow_sensitivity;
  107.       Dimension         detail_shadow_thickness;
  108.       unsigned char  arrow_orientation;    /* Xm_ARROWS_{VERTICAL,HORIZONTAL} */
  109.       
  110. #ifdef _SGIMOTIF
  111.       XtPointer    _SG_vendorExtension;
  112. #endif
  113.  
  114. } XmSpinBoxPart;
  115.  
  116.  
  117. /*  Full instance record declaration  */
  118.  
  119. typedef struct _XmSpinBoxRec
  120. {
  121.   CorePart              core;
  122.   CompositePart         composite;
  123.   ConstraintPart        constraint;
  124.   XmManagerPart         manager;
  125.   XmSpinBoxPart         spinBox;
  126. } XmSpinBoxRec;
  127.  
  128. /*  Macros */
  129. #define XmRPositionValue    "PositionValue"
  130.  
  131. #define SB_GetConstraintRec(w) \
  132.   ((XmSpinBoxConstraint)(&((XmSpinBoxConstraintPtr) (w)->core.constraints)->spinBox))
  133.  
  134. #define SB_WithChild(w) \
  135.   (((XmSpinBoxRec *) (w))->spinBox.textw != NULL)
  136.  
  137. #define SB_ChildCount(w) \
  138.   (((XmSpinBoxRec *) (w))->composite.num_children)
  139.  
  140. #define SB_GetArrowOrientation(w) \
  141.   (((XmSpinBoxRec *) (w))->spinBox.arrow_orientation)
  142.  
  143. #define SB_ChildIsNumeric(wc) \
  144.   (((XmSpinBoxConstraint) (wc))->sb_child_type == (unsigned char) XmNUMERIC)
  145.  
  146. #define SB_ChildPositionTypeIsValue(wc) \
  147.   (((XmSpinBoxConstraint) (wc))->position_type == \
  148.    (unsigned char) XmPOSITION_VALUE)
  149.  
  150. #define SB_ChildMaximumPositionValue(wc) \
  151.   ( ( ((wc) == (XmSpinBoxConstraint) NULL) ?  \
  152.         0 : \
  153.         ( (SB_ChildIsNumeric(wc)) ? \
  154.         (wc)->maximum_value : \
  155.             ( ((wc)->num_values  > 0) ? \
  156.         ((wc)->num_values - 1) : \
  157.         0 \
  158.         ) \
  159.     ) \
  160.     ) \
  161.   )
  162.  
  163. #define SB_ChildMinimumPositionValue(wc) \
  164.   ( ( ((wc) == (XmSpinBoxConstraint) NULL) ?  \
  165.         0 : \
  166.         ( (SB_ChildIsNumeric(wc)) ? \
  167.           (wc)->minimum_value : \
  168.           0 \
  169.         ) \
  170.     ) \
  171.   )
  172.  
  173. #endif  /* _SpinBP_h */
  174. /* DON'T ADD ANYTHING AFTER THIS #endif */
  175.  
  176.  
  177.  
  178.